package com.sims.action.bbs;

import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.Post;
import com.sims.service.BBSService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

public class DeletePostAction extends ActionEnhanced {
	private Post post;
	@Autowired
	private BBSService bbsService;
	public Post getPost() {
		return post;
	}
	public void setPost(Post post) {
		this.post = post;
	}
	
	@Override
	public String execute() {
		
		result = bbsService.deletePost(post);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
}
